package demo;

import lombok.NoArgsConstructor;

@NoArgsConstructor
public class SliverCard extends Card {
    public SliverCard(String cardId, String name,String phone, double money) {
        super(cardId, name, phone,money);
    }
    @Override
    public void consume(double money) {
        System.out.println("当前消费金额" + money);
        System.out.println("当前消费打折后金额" + 0.9 * money);
        if(getMoney()< 0.9*money){
            System.out.println("您当前余额为"+getMoney()+"余额不足,请存钱");
            return;
        }
        //更新账户金额
        setMoney(getMoney() - 0.9 * money);
    }
}
